Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

bitbadgesjs-address-converter

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bitbadgesjs-address-converter

Address converter, convert ETH address to Ethermint/evmos/cosmos/bitbadges addresses.

  • 0.0.2
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

BitBadgesJS EIP712

This library was forked from EvmosJS. Replace @tharsis/address-converter with bitbadgesjs-address-converter

Address converter

A simple converter between ETH address and Ethermint/evmos addresses.

Installation

npm install @tharsis/address-converter

Usage

Converter

import {ethToEthermint, ethermintToEth} from "@tharsis/address-converter"

let address = ethToEthermint("0xe2D61e49ff8a9d724CC54d338D8076F878aC6b71")
// "ethm1uttpuj0l32whynx9f5ecmqrklpu2c6m3973048"

let address = ethermintToEth("ethm1uttpuj0l32whynx9f5ecmqrklpu2c6m3973048")
// "0xe2D61e49ff8a9d724CC54d338D8076F878aC6b71"

Decoders

import {ETH, ETHERMINT} from "@tharsis/address-converter"
let hex = ETH.decoder("0xe2D61e49ff8a9d724CC54d338D8076F878aC6b71")
// hex.toString('hex') === "e2d61e49ff8a9d724cc54d338d8076f878ac6b71"

hex = ETHERMINT.decoder("ethm1uttpuj0l32whynx9f5ecmqrklpu2c6m3973048")
// hex.toString('hex') === "e2d61e49ff8a9d724cc54d338d8076f878ac6b71"

Encoders

import {ETH, ETHERMINT} from "@tharsis/address-converter"
let address = ETH.encoder(Buffer.from("e2d61e49ff8a9d724cc54d338d8076f878ac6b71","hex"))
// address === "0xe2D61e49ff8a9d724CC54d338D8076F878aC6b71"

address = ETHERMINT.encoder(Buffer.from("e2d61e49ff8a9d724cc54d338d8076f878ac6b71","hex"))
// address === "ethm1uttpuj0l32whynx9f5ecmqrklpu2c6m3973048"

EVMOS support

import {ethToEvmos, evmosToEth} from "@tharsis/address-converter"

let address = ethToEvmos("0x14574a6DFF2Ddf9e07828b4345d3040919AF5652")
// "evmos1z3t55m0l9h0eupuz3dp5t5cypyv674jj7mz2jw"

let address = evmosToEth("evmos1z3t55m0l9h0eupuz3dp5t5cypyv674jj7mz2jw")
// "0x14574a6DFF2Ddf9e07828b4345d3040919AF5652"

Reference

  • ENSDOMAINS-AddressEnconder

FAQs

Package last updated on 06 Sep 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc